import myAxios from '@/utils/request'

export const getCategoryListApi = () => myAxios.get('/categorys/list')

export const addCategoryApi = (data) => myAxios.post('/categorys', data)

export const updateCategoryApi = (data) => myAxios.put('/categorys', data)

export const getCategoryByIdApi = (id) => myAxios.get(`/categorys/${id}`)

export const delCategoryByIdApi = (id, flag) =>
  myAxios.delete(`/categorys/${id}`, {
    params: {
      flag: flag
    }
  })
